Skip to content

fix(plugin-detail): the Overview draws a record's own field groups before its master-detail tables, at the list's dense height - #35824

Merged
objectstack-fleet[bot] merged 7 commits into
mainfrom
claude/issue-35742-overview-body-table-order
Nov 20, 2026
Merged

objectstack-fleet[bot] merged 7 commits into
mainfrom
claude/issue-35742-overview-body-table-order

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #35742
Part of #35590

Clause-②: no
Metadata-protocol: none

维护者速读

  • 打开记录页的「概览」时,先看到这条记录自己的字段分组,主从子表排在字段下面;子表行高与列表一致,表格不再出现被裁掉半截的列(放不下的列收进「全部列」)。
  • 属于「记录详情页重做」专题,是上一轮主从子表上概览之后的修正,解决打开记录先看到子表、行太高、列被裁半截三个问题。
  • 出错时最多是概览里字段和子表的上下顺序或列数不对,数据与编辑保存不受影响,撤回本合并即可恢复原样。
  • 请确认「默认折叠的分组排在子表之后、展开的分组(含「更多详情」)排在子表之前」这一取舍;另有一份已有的设计裁决记录需要补一条修订说明,交由席位处理(见下文)。

What changes

Order (the synthesized record page's Overview, bodyTablePlacement in buildDefaultPageSchema.ts). A master-detail body table now follows the field sections the page draws OPEN, instead of leading every section. The left column reads: the strip (key fields, stage bar; full width, unchanged) then the record's field groups then its body tables. An object with no stage bar and no key fields opens on its own fields. A field group whose relatedList names a body table still places that table at the group's position (unchanged).

Default-collapsed groups: my call, and why. The principle on the card is "common fields before the tables". A section the page draws CLOSED when it opens is, by its author's own declaration, not a common one: a field group with collapse: 'collapsed', or an enumerated section that is collapsible and defaultCollapsed. So the closed sections that TRAIL the last open one follow the tables. Two limits keep the rule from reordering anything an author wrote:

  • a closed section BETWEEN two open ones keeps its declared place (before the tables); the sections' own order never changes;
  • when every section is closed, the tables follow all of them, so the record's own fields always lead.

The console host's "More details" section (deriveRecordDetailSections) is collapsible but opens EXPANDED (defaultCollapsed: false), so it is drawn open and stays before the tables. The card describes it as default-collapsed; on main it is not, and I keyed the rule on what the reader actually sees closed rather than on the section's name. An object whose author marks a group collapse: 'collapsed' gets that group after the tables.

Density (RelatedList.tsx, the body-table face only). BODY_TABLE_DENSITY puts a body table's header at 32px and its data cells at 32px with no vertical padding (the row-actions cell included), the same measures object-grid draws a list's compact rows with. It is applied only when the list is a body table; every other related list keeps its face.

Width (RelatedList.tsx, the body-table face only). A body table draws the leading run of its columns, in their priority order (the order the list derives, name first), that fits whole in the details column, and offers the rest behind its labelled ⤢ "All columns" button (the enlarged tab, which draws every column). Widths are the inline widths the table gives each header (the user's resize, the declared width or the drawn-content estimate), cached per column key, so a column left out is still counted when the column grows. A table whose FIRST column alone is wider than the box still scrolls inside it with that column pinned (the existing sideways-scroll behaviour, now only the fallback). Never fewer than one column.

Untouched: tab rules, the right rail, the header (the strip still sits above both columns), body tables appear only in the Overview, the edit state's RecordBodyTableEditorSlotContext path (the host's editor replaces the list, so neither change reaches it), and handleAddRecords.

Tests

Migrated pins (each one's expectation flipped to the new order; none retired):

File Case Before Now
buildDefaultPageSchema.bodyTables-27055.test.ts splits the details around the body tables; each side list takes a tab of its own tables, then details details, then tables
same with one section the tables lead it, renamed "with one section the tables follow it" table, details details, table
same the laid-out page draws them in the details column table, details details, table
same the table named by a group sits at that group; the others keep "before the sections", renamed "...after the sections" unplaced table first unplaced table last
same an object.field entry names the one FK; another FK places nothing (second expectation) table, details details, table
same a group only positions a body table: naming a side card promotes nothing table, details details, table
RelatedList.bodyTable-27055.test.tsx eight columns in the details column: shadow, a pinned first column, ⤢ in words scrolls, first column pinned, shadow the leading columns that fit whole are drawn, the rest omitted (count on data-body-table-columns-omitted), no scroll, no pin, no shadow, ⤢ in words
same scrolled to the end, the trailing shadow clears and the pinned column stays 680px box, eight columns now the fallback: a box narrower than the first column, which still scrolls, pinned, shadow clears at the end

Unchanged and still green: "with no section the details node leads", "a group declared before every field group puts its table first", "a group declared last puts its table after every field section", the host-passed { group } sections case, and the three-columns CONTROL (now also asserting all three columns are drawn).

New pins:

  • an object with no stage bar and no key fields: strip empty, details(basic) then table(meeting_todo);
  • with a key-fields strip: strip record:highlights, then groups, then the table;
  • with key fields and a stage bar: strip record:highlights, record:path, then groups, then the table;
  • a trailing collapsed group follows the tables; a closed group between open ones stays; an expanded group stays before; every section closed puts the tables last; the enumerated collapsible + defaultCollapsed form trails while an open "More details" leads; a group-placed table keeps its position ahead of a trailing closed group;
  • bodyTableColumnsThatFit: the leading run that fits, never fewer than one, null when all fit or a width is unknown;
  • density: a body table's root carries every BODY_TABLE_DENSITY class (32px header, 32px cells, no vertical padding); CONTROL: the same list outside the body-table set does not;
  • CONTROL (placement): an object with no body table draws one details node, and a side list never joins the Overview.

Acceptance notes

  • ADR-0035 text now describes the old order. Its 2026-11-19 amendment note says a body table "sits in the overview's details column under the header strip and above the field sections". This PR implements the card's order (field groups first). docs/adr/** is outside this claim's file surface and is a governed surface, so the add-only amendment note is left to the seat (named in the report), not written here.
  • Totals for an omitted column. A body table's totals row is the table's own last row; a column the table leaves out takes its total with it. The ⤢ "All columns" tab shows every column and its total.
  • Row height reading. The card measured 65px on the old rows. At 1280 in Chromium the new body-table rows read a 32px row pitch, equal to the expense-line list page's compact rows measured in the same session (both tables are border-collapse, so the 1px row line is shared: the "33" of the list's density comment counts the line separately).

Verification

Read first, by risk:

  1. RelatedList.tsx, the measuring read() inside the body-table layout effect: the column-fit read, its MutationObserver (the table settles its columns a render after it is handed fewer), and the guard that a header with no width yet records nothing.
  2. buildDefaultPageSchema.ts, bodyTablePlacement: tablesAt and the slot loop (placed tables flush before the unplaced ones at the split).
  3. sectionDrawnClosed: a { group } reference is judged through deriveFieldGroupDetailEntries, the same derivation record:details resolves it with.

Two-minute check: open any showcase expense report (pnpm dev, Expense Reports, any record) at 1280 wide. Expected: stage bar, then the Report, Totals and Other groups, then "Expense Lines" with five whole columns, an "All columns" button, rows the height of the list page's rows, and no column cut at the table's right edge.

Test readings (head 873a23d, after merging origin/main)

Final-head readings are in the os-dev report on the card, with each command and its VERDICT line. Before the merge, on the same diff:

  • buildDefaultPageSchema.bodyTables-27055.test.ts + RelatedList.bodyTable-27055.test.tsx: Test Files 2 passed (2), Tests 56 passed (56).
  • packages/plugin-detail/src/synth/ + renderers/__tests__/record-related-list* (includes the edit-state editorSlot-35599 pin): Test Files 25 passed (25), Tests 271 passed (271).
  • packages/plugin-detail/src/__tests__/RelatedList* + RecordPageColumns*: Test Files 59 passed (59), Tests 402 passed (402).
  • app-shell RecordDetailView.harness, recordPageTiers-26678, childWriteRefreshesParent-12244, relatedListFilter-4664, recordEditState.helpers-35599, plugin-grid emptyArrayCell-8481, relatedListRowActionDisabled-33215: Test Files 7 passed (7), Tests 105 passed (105).
  • pnpm --filter @object-ui/plugin-detail run type-check (tsc --noEmit && tsc -p tsconfig.test.json): exit 0. It caught one test using collapse: 'collapsible', which is not a spec value; the case now uses expanded.
Ablations (scripts/ablation-replace.mjs, mutation proven on disk, restore proven by blob hash and an empty diff)
  1. buildDefaultPageSchema.ts: const tablesAt = lastOpen === -1 ? resolved.length : lastOpen + 1; replaced by const tablesAt = 0; (tables before every section, the old order). Anchor 1 to 0, blob a0218d67 to e8e8dbe2. Placement file: 15 failed, 9 passed (24). Red: every migrated order pin and every new order pin. Green: the CONTROL, the page-size and side-list cases, and the group-placed-first case, which do not depend on the split. Restored: blob back to a0218d67 (HEAD), git diff HEAD empty.
  2. RelatedList.tsx: the over-budget branch of bodyTableColumnsThatFit, return Math.max(1, index);, replaced by return null; (never omit). Blob eb8e3656 to 107ffa88. Renderer file: 4 failed, 28 passed (32). Red: the eight-columns case, the first-column fallback, and two bodyTableColumnsThatFit cases. Green: the three-columns CONTROL and the density pins. Restored: blob back to eb8e3656 (HEAD), git diff HEAD empty.
A4 browser reading (1280x900, DSF 2, headless Chromium, showcase backend on a private port, Console dev server)

Showcase expense report EXP-2001 (stage bar, three field groups, master-detail child Expense Lines), tier wide:

  • details column children, top to bottom: details (Report, Totals, Other) at y 236, body table at y 668, record footer at y 972;
  • body table: header height 32, data-row pitch 32 (the list page showcase_expense_line, same session: header 32, row pitch 32); data-body-table-columns-omitted="1"; five columns drawn, the last ending at x 810 inside the box's right edge at 811; scrollWidth 744 equals clientWidth 744 (no sideways scroll); "All columns" offered in words;
  • page errors: 0.

Screenshots: expense-1280x900.png, expense-body-table.png in the claim's a4-35742 folder. The showcase's invoice and project records draw authored pages, not the synthesized one, so the no-stage case is pinned in tests rather than read in the browser.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint is CI's run and was not run locally.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: not touched.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English (the maintainer brief is Chinese by rule).
  • The Before Submitting list in CONTRIBUTING.md is done.

Generated by Claude Code

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 20, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4

维护者速读

  • 记录页「概览」里,主从子表现在排在记录自己的字段分组下面:阶段条、关键字段、字段分组,然后才是子表;没有阶段条和关键字段的对象,最上面就是自己的字段。
  • 默认折叠的分组(如「更多详情」)如果排在最后,就放到子表后面;夹在展开分组中间的保持原位。
  • 子表行高改成和列表密排一致(行 33、表头 32)。
  • 子表放不下的列不再露出半截:只画能完整放下的前几列,其余点「全部列」查看。
  • 需要留意:被省略的列如果是金额列,它的合计也不在概览里显示,要到「全部列」里看;建议另开一张小卡补上。
  • 席位意见:通过,分区自己合并;合并前建好上面那张后续卡。

席位核对

ACCEPT · head 873a23d10b · Fixes #35742 (child of #35590, maintainer direct dispatch; seat rulings 10:12Z) · K=4 · merge-tree vs origin/main clean (over #35811's RelatedList.tsx) · governed: no · +426/−51, 5 files · CI 42 success, 13 skipped, 0 pending · draft · 2026-11-20T10:24Z

Routing: no packages/spec face, Clause-②: no, not governed → the area lands it after R1; mark ready first.

Checked:

  • bodyTablePlacement: sectionDrawnClosed reads a field group's resolved section (deriveFieldGroupDetailEntries) or a section's own collapsible && defaultCollapsed; unplaced tables go after the LAST open section (tablesAt), so a closed section between open ones keeps its place and trailing closed ones follow the tables; all closed → tables last; a group-placed table keeps its group's slot. The ADR-0035 wording is left to the add-only note PR per seat ruling (1); 「更多详情」 opens expanded and stays before the tables per ruling (2). The synthTabs hunk is comment only, so ux-1's tab rules are untouched.
  • BODY_TABLE_DENSITY: h-8 header and cells, py-0, 13px, on the body-table face only (bodyTable ? { className }).
  • Width: bodyTableColumnsThatFit returns the count of leading columns that fit whole (at least 1), or null when all fit or a width is unknown. Widths prefer the declared minWidth, then the remembered width, then the drawn one, so a column that widens after a neighbour is dropped does not reflow the cap (no oscillation); the map resets when the column keys change. Non-data columns (data-column-key absent) are subtracted first. A first column wider than the box still scrolls, pinned. ⤢ 「All columns」 shows whenever columns are omitted or it overflows.
  • handleAddRecords and the feat(app-shell, plugin-approvals): edit a record and its line tables in one save; a locked record locks its lines #35755 editor slot are untouched. Surface: all 5 files inside the claim (placement in buildDefaultPageSchema.ts, body-table face in RelatedList.tsx, tests, changeset).
  • A4 measured on showcase EXP-2001 at 1280×900; the no-stage object (the card's 「会议」 case) is pinned in units.

Required before landing:

Nit (no action required):

  • The MutationObserver on the table box re-reads on every cell mutation; setState with an equal value bails, so this costs reads, not renders. Fine at body-table sizes (10 rows).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ

Landing · area ux-2 · 2026-11-20T10:28Z

reading value
L1-a ACCEPT comment 7037129863 at 873a23d10b (= current head)
Seat no L2 owed (no packages/spec face, Clause-② no). Rulings 10:12Z: (1) the ADR-0035 note goes in a separate add-only PR by ux-2; (2) 「More details」 opens expanded and stays before the tables
R1 follow-up card #35831 (totals of columns dropped for width), nested under #35742
CI green at 873a23d10b (42 success, 13 skipped, 0 failed); K = 4 (< 15); merge-tree vs origin/main clean
check-governed-merges --pr 35824 NOT governed; +426 / −51 ≤ 3000

State: draft → ready + auto-merge (merge queue). Fixes #35742 closes the card on merge. ux-2 then opens the ADR-0035 note PR and closes out #35742 when that note lands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

记录页概览:主从子表排到了主记录字段的上面,行高 65;应在字段下面、按密排行高

2 participants